<?php
class UserVipShopBuyAction extends SzAbstractAction {
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * @param $userId
     * @param $itemId
     * @param $reqTime
     * @return SzResponse
     * @throws SzException
     */
    public function execute($userId,$itemId,$reqTime) {
        //验证系统功能是否开启
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_VIP_SHOP)) {
            return $this->buildResponse(false);
        }

        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);
        $isSuc = UserVipShopService::get()->buyVipShop($userId,$itemId,$reqTime);

        return $this->buildResponse(
            $isSuc
        );
    }
}